package cn.wolfcode.trip.app.controller;


import cn.wolfcode.trip.base.domain.Attention;
import cn.wolfcode.trip.base.service.IAttentionService;
import cn.wolfcode.trip.base.util.JSONResult;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonRawValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 关注控制器
 */
@RestController
@RequestMapping("/attentions")
public class AttentionController {
    @Autowired
    private IAttentionService attentionService;

    /**
     * 用户关注他人
     * @return
     */
    @PostMapping
    public JSONResult save(Attention attention){
        attentionService.save(attention);
        return new JSONResult();
    }

    @DeleteMapping
    public JSONResult delete(Attention attention){
        attentionService.delete(attention);
        return new JSONResult();
    }
}